<?php

require_once('../include/GeneralTop.php');
require('../include/class/db.php');

if (!$content_admin) {
	die('<div style="text-align:center">Permission denied...</div>');
}

$id = "-1";
if (isset($_GET['recordID'])) {
    $id = $_GET['recordID'];
}

$db = new db;
$sql = sprintf("SELECT * FROM pet_info WHERE PAId = %s", GetSQLValueString($id, "int"));
$res = $db->query($sql);
$row = $db->fetch($res);

include('AdminPanel.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table width="50%"  border="0" align="center" cellpadding="5" cellspacing="0" class="table_border_grey" style="margin-top:10px;">
    <tr valign="baseline">
      <td nowrap="nowrap" align="right" width="20%">宠物名:</td>
      <td width="80%"><?php echo $row['PAPetName']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right" width="20%">编号:</td>
      <td width="80%"><?php echo $row['guid']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">品种:</td>
      <td><?php echo $row['PVariety']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">宠物来源:</td>
      <td><?php echo getOrigin($row['pet_origin'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">救助日期:</td>
      <td><?php echo $row['PADate']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">到达分会日期:</td>
      <td><?php echo $row['arrive_date']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">弃养原因:</td>
      <td><?php echo $row['PAMemo']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">种类:</td>
      <td><?php echo getPetType($row['PType'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">性别:</td>
      <td><?php echo getGender($row['PGender'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">年龄:</td>
      <td><?php echo $row['age']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">年龄类别:</td>
      <td><?php echo getAgeGrp($row['age_grp'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">是否绝育:</td>
      <td><?php echo getSpay($row['spay_YN'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">绝育日期:</td>
      <td><?php echo $row['spay_date']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">是否免疫:</td>
      <td><?php echo getVaccinate($row['vaccinated_YN'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">免疫日期:</td>
      <td><?php echo $row['vaccinated_date']?></td>
    </tr><tr valign="baseline">
      <td nowrap="nowrap" align="right">是否体内驱虫:</td>
      <td><?php echo getDewormin($row['dewormIn_YN'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">体内驱虫日期:</td>
      <td><?php echo $row['dewormInDate']?></td>
    </tr><tr valign="baseline">
      <td nowrap="nowrap" align="right">是否体外驱虫:</td>
      <td><?php echo getDewormext($row['dewormExt_YN'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">体外驱虫日期:</td>
      <td><?php echo $row['dewormExtDate']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right" valign="top">健康情况:</td>
      <td><?php echo nl2br($row['Pet_healthinfo'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right" valign="top">性格和其他描述:</td>
      <td><?php echo nl2br($row['Pet_otherinfo'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right" valign="top">故事:</td>
      <td><?php echo nl2br($row['story'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">是否接受医生诊断:</td>
      <td><?php echo getDoctorCheck($row['Doctor_check'])?></td>
    </tr>    
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">是否已领养:</td>
      <td><?php echo getIsAdopt($row['PIsAdopt'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">领养日期:</td>
      <td><?php echo $row['adiopted_date']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">领养记录:</td>
      <td><?php echo $row['adoption_history']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">领养人姓名:</td>
      <td><?php echo $row['PAAdopter']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">领养人性别:</td>
      <td><?php echo getMemberSex($row['Adopter_sex'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">领养人身份证:</td>
      <td><?php echo $row['Adopter_ID']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">领养人工作单位:</td>
      <td><?php echo $row['Adopter_workplace']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">领养人电话:</td>
      <td><?php echo $row['adopter_phone']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">领养人地址:</td>
      <td><?php echo $row['adopter_address']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">救助人姓名:</td>
      <td><?php echo $row['Rescuer_name']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">救助人性别:</td>
      <td><?php echo getMemberSex($row['Rescuer_sex'])?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">救助人电话:</td>
      <td><?php echo $row['Rescuer_phone']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">救助人地址:</td>
      <td><?php echo $row['Rescuer_address']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">联系方式:</td>
      <td><?php echo $row['contact_way']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right" valign="top">退养原因:</td>
      <td><?php echo $row['reason_for_return']?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right" valign="top">照片:</td>
      <td>
      <?php
      if($row['PPhoto_main'] != NULL && $row['PPhoto_main'] != '') {
      ?>
      <img src="<?php echo IMAGES_PET_FOLDER.$row['PPhoto_main']; ?>" border="0" class="img_border">&nbsp;
      <?php
      }
      if($row['photo_detail1'] != NULL && $row['photo_detail1'] != '') {
      ?>
      <img src="<?php echo IMAGES_PET_FOLDER.$row['photo_detail1']; ?>" border="0" class="img_border">&nbsp;
      <?php
      }
      if($row['photo_detail2'] != NULL && $row['photo_detail2'] != '') {
      ?>
      <img src="<?php echo IMAGES_PET_FOLDER.$row['photo_detail2']; ?>" border="0" class="img_border">
      <?php
      }
      ?>
      </td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">&nbsp;</td>
      <td>
        <input type="button" id="button" onclick="window.location.href='ShowPetInfo.php'" value="Back">
	  </td>
    </tr>
</table>

</body>
</html>